package com.njtoyo.taxi.admin.rest.presenter.platfrom;

import com.njtoyo.taxi.admin.library.common.GeoPoint;
import com.njtoyo.taxi.entity.backend.AdminUser;
import com.njtoyo.taxi.entity.backend.Enum;
import com.njtoyo.taxi.entity.backend.Role;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;

@Data
@Accessors(chain = true)
public class AdminUserDetailPresenter {
    private long id;
    private String name;
    private String account;
    private String mobileNumber;
    private String email;
    private Enum.AccountType accountType;
    private Date createdAt;
    private Date updatedAt;
    private Set<Role> roles;
    private AdminUser superior;

    private GeoPoint defaultPoint;
    private List<Long> identityIds;

    public void setDefaultPoint(Double longitude, Double latitude) {
        if (Objects.nonNull(longitude) && Objects.nonNull(latitude)) {
            this.defaultPoint = new GeoPoint(longitude, latitude);
        }
    }

    private Boolean isPhoneOnline;
}

